package cn.ljy.authority.model;

import cn.ljy.common.model.BaseModel;
import cn.ljy.common.model.validate.UpdateWorkValidation;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@ApiModel(value="系统日志类型")
@Data
@EqualsAndHashCode(callSuper = false,of = {"id"})
@NoArgsConstructor
public class SysDailyType extends BaseModel {
    @NotNull(groups = UpdateWorkValidation.class,message="id不能为空")
    private Long id;
    @NotBlank(message = "名称不能为空")
    @Length(min = 1, max = 20, message = "名称长度必须在 {min} - {max} 之间")
    private String name;
    @NotNull(message = "排序不能为空")
    private Integer sort;//排序，升序
    private Boolean display;//是否在前台显示，同时也决定该类别下的文章是否显示

    //非数据库字段
    private Integer dailyNumber;//日志类型下的日志数量
}
